<template>
  <div class="app-container">
    <!-- <div class="search-container">
      <el-form ref="queryFormRef" :model="queryForm" :inline="true">
        <el-form-item prop="keywords">
          <el-input v-model="queryForm.keywords" placeholder="请输入关键字" clearable style="width: 200px" />
          <el-button type="primary" style="margin-left: 0; border-radius: 0" @click="handleQuery"> 搜索 </el-button>
        </el-form-item>
      </el-form>
    </div> -->
    <div class="table-container">
      <el-row :gutter="20">
        <el-col :span="24" :offset="0" style="margin-top: 10px">
          <el-table ref="tableRef" v-loading="loading" :data="tableData" style="width: 100%">
            <el-table-column label="单位名称" prop="corpName" min-width="250" />
            <el-table-column label="单位统一社会信用代码" prop="corpCode" min-width="160" />
            <el-table-column label="单位类型" prop="typeName" min-width="100" />
            <el-table-column label="参建类型" prop="roleName" min-width="100" />
            <el-table-column label="参建状态" prop="constructionStatusName" min-width="100" />
            <el-table-column label="法定代表人姓名" prop="legalMan" min-width="150" />
            <el-table-column label="法定代表人电话" prop="legalMobile" min-width="150" />
            <el-table-column label="联系人电话" prop="linkTel" min-width="120" />
            <el-table-column label="项目管理部编码" prop="projectManageCode" min-width="120" />
          </el-table>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script setup lang="ts">
import { QueryProjectCorpPage } from "@/api/project/build/index";

const props = defineProps({
  id: {
    type: Number,
    default: 0,
  },
});
const { id } = toRefs(props);

const loading = ref(false);
const tableData = ref();
const dialogAddOrEdit = reactive<DialogOption>({
  visible: false,
});
const tableRef = ref();

//这是列表数据
const handleQuery = function () {
  loading.value = true;
  QueryProjectCorpPage(id.value)
    .then((res) => {
      if (res.type === 0) {
        if (res.success) {
          tableData.value = res.data;
        } else {
        }
      } else {
      }
    })
    .finally(() => {
      loading.value = false;
    });
};
onMounted(() => {
  handleQuery();
});
</script>
<style scoped>
:deep(.el-button) {
  margin-left: 5px;
}
:deep(.el-input__wrapper) {
  border-radius: 0;
}
</style>
